import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 数据查询默认类型信息 */
export interface DataQueryNomralType {
          id: number; // ID
          userId?: number; // 用户ID
          typeCode?: string; // 默认Api类型Code
  }

// 数据查询默认类型 API
export const DataQueryNomralTypeApi = {
  // 查询数据查询默认类型分页
  getDataQueryNomralTypePage: async (params: any) => {
    return await request.get({ url: `/business/data-query-nomral-type/page`, params })
  },

  // 查询数据查询默认类型详情
  getDataQueryNomralType: async () => {
    return await request.get({ url: `/business/data-query-nomral-type/get`})
  },

  // 新增数据查询默认类型
  createDataQueryNomralType: async (data: DataQueryNomralType) => {
    return await request.post({ url: `/business/data-query-nomral-type/create`, data })
  },

  // 修改数据查询默认类型
  updateDataQueryNomralType: async (data: DataQueryNomralType) => {
    return await request.put({ url: `/business/data-query-nomral-type/update`, data })
  },

  // 删除数据查询默认类型
  deleteDataQueryNomralType: async (id: number) => {
    return await request.delete({ url: `/business/data-query-nomral-type/delete?id=` + id })
  },

  /** 批量删除数据查询默认类型 */
  deleteDataQueryNomralTypeList: async (ids: number[]) => {
    return await request.delete({ url: `/business/data-query-nomral-type/delete-list?ids=${ids.join(',')}` })
  },

  // 导出数据查询默认类型 Excel
  exportDataQueryNomralType: async (params) => {
    return await request.download({ url: `/business/data-query-nomral-type/export-excel`, params })
  },
}
